<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>XML Validation</title>
<title>CMSIS-Pack: XML Validation</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="printComponentTabs.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 46px;">
  <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">CMSIS-Pack
   &#160;<span id="projectnumber">Version 1.6.3</span>
   </div>
   <div id="projectbrief">Delivery Mechanism for Software Packs</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
    <ul class="tablist">
      <script type="text/javascript">
		<!--
		writeComponentTabs.call(this);
		//-->
      </script>
	  </ul>
</div>
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('cp_Editors.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">XML Validation </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>XML validation is especially important when a pack should published using a <a class="el" href="createPackPublish.html#cp_KeilComPack">pack index service</a>. The pack importer will ignore all <b>&lt;vendor&gt;</b>.<b>&lt;name&gt;</b>.pdsc files that do fail when checking against the current PACK.xsd schema file and thus your pack will not be available for download.</p>
<h1><a class="anchor" id="cp_valEditor"></a>
Using an editor</h1>
<p>Some text editors are capable of verifying XML code against a schema file. This is helpful to identify syntactical or structural problems in a PDSC or SVD file early in the development process. Useful editors are:</p>
<ul>
<li><a href="https://notepad-plus-plus.org/" target="_blank">Notepad++</a></li>
<li><a href="https://code.visualstudio.com/" target="_blank">Visual Studio Code</a></li>
</ul>
<p>Usually, the XML file that is to be validated and its corresponding schema file need to reside in the same directory. The CMSIS-Pack schema file <b>Pack.xsd</b> and the CMSIS-SVD schema file <b>CMSIS-SVD.xsd</b> are available in the directory <b>.\CMSIS\Utilities</b> of the <b>ARM::CMSIS</b> Pack.</p>
<h1><a class="anchor" id="cp_Editors_xmllint"></a>
Using xmllint</h1>
<p>The utility <a href="http://xmlsoft.org/xmllint.html" target="_blank">xmllint</a> is a command line tool for XML validation against a schema file. It may be part of the <a class="el" href="bash_script.html">Bash Script gen_pack.sh</a> to verify the PDSC file during pack generation.</p>
<p><b>Installing on Linux</b></p>
<p>Use your package manager to install the <code>libxml2-utils</code> (which contain xmllint). On a Ubuntu machine, use: </p>
<div class="fragment"><div class="line">$ sudo apt-<span class="keyword">get</span> install libxml2-utils</div>
</div><!-- fragment --><p><b>Installing on Windows</b></p>
<p>For Windows <a href="https://www.zlatkovic.com/pub/libxml/" target="_blank"><b>libxml</b></a> provides an XML processor that provides the functionality of <b>xmllint</b>.</p>
<dl class="section note"><dt>Note</dt><dd>The installation is optional but strongly recommended to be able to validate the XML file using <code>gen_pack.sh</code>.</dd></dl>
<p>Download the following ZIP files:</p>
<ul>
<li><b>iconv-1.9.2.win32.zip</b></li>
<li><b>libxml2-2.7.8.win32.zip</b></li>
<li><b>libxmlsec-1.2.18.win32.zip</b></li>
<li><b>zlib-1.2.5.win32.zip</b></li>
</ul>
<p>Extract the <b>/bin</b> directory of each ZIP file to a directory, for example <b>C:\xmllint</b> and add this directory to the Windows <a href="https://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/adding-path-variable/97300613-20cb-4d85-8d0e-cc9d3549ba23" target="_blank"><b>PATH</b></a> environment variable.</p>
<dl class="section note"><dt>Note</dt><dd><ul>
<li>Restart the <b>Git Bash</b> after changing the <b>PATH</b> environment variable.</li>
<li>When <b>xmllint</b> is not installed, the XML schema verification is skipped by the <a class="el" href="bash_script.html">gen_pack.sh</a> script.</li>
</ul>
</dd></dl>
<p>xmllint is also provided by the xsltproc package that can be installed via <a href="https://chocolatey.org/packages/xsltproc" target="_blank"><b>Chocolatey</b></a>: </p>
<div class="fragment"><div class="line">&gt; choco install xsltproc</div>
</div><!-- fragment --><h1><a class="anchor" id="cp_validationPI"></a>
Using Pack Installer</h1>
<p>Arm Keil MDK includes <b>Pack</b> <b>Installer</b> which tou can use to validate the schema of your PDSC file.</p>
<ul>
<li>Right-click on the pack version number and select <b>Schema Check</b>: <br/>
 <div class="image">
<img src="schema_check.png" alt="schema_check.png"/>
</div>
</li>
<li>The <b>Output</b> window shows the result. If errors are reported, please make sure to fix them before continuing.<br/>
 <div class="image">
<img src="schema_check_output.png" alt="schema_check_output.png"/>
</div>
 </li>
</ul>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="createPackUtil.html">Utilities for Creating Packs</a></li>
    <li class="footer">Generated on Mon Feb 1 2021 16:48:05 for CMSIS-Pack Version 1.6.3 by Arm Ltd. All rights reserved.
	<!--
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 
	-->
	</li>
  </ul>
</div>
</body>
</html>
